﻿<UserControl x:Class="EpiDashboard.Controls.StratifiedTableAnalysisPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             xmlns:dashboard="clr-namespace:EpiDashboard"
             xmlns:Controls="clr-namespace:EpiDashboard.Controls"
             Width="Auto"
             Height="Auto"
             >
    <UserControl.Resources>
        <ResourceDictionary Source="../ResourceDictionary.xaml" />
    </UserControl.Resources>
    <Grid Name="grdResults" Width="Auto" Height="Auto" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,0,0,0" Visibility="Visible" SnapsToDevicePixels="True">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <Border Grid.Row="0" Grid.ColumnSpan="3" Style="{DynamicResource gridCellBorder}" BorderThickness="0,1,0,1">
            <TextBlock Grid.Row="0" FontWeight="Bold" Margin="0,1,0,1" HorizontalAlignment="Center" FontSize="14">Summary Results</TextBlock>
        </Border>

        <Grid Grid.Row="1" Margin="0,14,0,0" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>

            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="0" FontWeight="DemiBold" HorizontalAlignment="Center">Odds Ratio</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="1" FontWeight="DemiBold" HorizontalAlignment="Center">Estimate</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="2" FontWeight="DemiBold" HorizontalAlignment="Center">Lower</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="3" FontWeight="DemiBold" HorizontalAlignment="Center">Upper</TextBlock>

            <Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"></Border>            
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="0">Crude (cross product)</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="0">Crude (MLE)</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="0">Fisher-Exact</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="0">Adjusted (MH)</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="0">Adjusted (MLE)</TextBlock>

            <TextBlock Name="txtStratCrudeOr"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratCrudeMle"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratFisher" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right"></TextBlock>

            <TextBlock Name="txtStratCrudeOrLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratCrudeMleLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratFisherLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratCrudeOrUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratCrudeMleUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratFisherUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratAdjustedOr"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratAdjustedMle"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratAdjustedOrLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratAdjustedMleLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="2" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratAdjustedOrUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratAdjustedMleUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStat1" Text="(T)" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="5" HorizontalAlignment="Center"></TextBlock>
            <TextBlock Name="txtStat2" Text="(M)" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="5" HorizontalAlignment="Center"></TextBlock>
            <TextBlock Name="txtStat3" Text="(F)" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="5" HorizontalAlignment="Center"></TextBlock>
            <TextBlock Name="txtStat4" Text="(R)" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="5" HorizontalAlignment="Center"></TextBlock>
            <TextBlock Name="txtStat5" Text="(F)" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="5" HorizontalAlignment="Center"></TextBlock>
        </Grid>
        
        <Grid Grid.Row="2" Margin="0,14,0,0" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBlock FontSize="10" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">(T=Taylor series; R=RGB; M=Exact mid-P; F=Fisher exact)</TextBlock>
            <!--<TextBlock Name="txtStat1Desc" Text="T" Grid.Row="0" Grid.Column="0" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>
            <TextBlock Name="txtStat2Desc" Text="M" Grid.Row="1" Grid.Column="0" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>
            <TextBlock Name="txtStat3Desc" Text="F" Grid.Row="2" Grid.Column="0" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>
            <TextBlock Name="txtStat4Desc" Text="R" Grid.Row="3" Grid.Column="0" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>

            <TextBlock Name="txtStat1DescLabel" Text="Taylor series" FontSize="9" Grid.Row="0" Grid.Column="1" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>
            <TextBlock Name="txtStat2DescLabel" Text="Exact mid-p" FontSize="9" Grid.Row="1" Grid.Column="1" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>
            <TextBlock Name="txtStat3DescLabel" Text="Fisher exact" FontSize="9" Grid.Row="2" Grid.Column="1" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>
            <TextBlock Name="txtStat4DescLabel" Text="RGB" FontSize="9" Grid.Row="3" Grid.Column="1" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}">n/a</TextBlock>-->
        </Grid>

        <Grid Grid.Row="3" Margin="0,14,0,0" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>

            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="0" FontWeight="DemiBold" HorizontalAlignment="Center">Risk Ratio</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="1" FontWeight="DemiBold" HorizontalAlignment="Center">Estimate</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="2" FontWeight="DemiBold" HorizontalAlignment="Center">Lower</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="3" FontWeight="DemiBold" HorizontalAlignment="Center">Upper</TextBlock>

            <Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"></Border>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="0">Crude</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="0">Adjusted</TextBlock>

            <TextBlock Name="txtStratCrudeRr"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratAdjustedRr"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratCrudeRrLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratAdjustedRrLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratCrudeRrUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratAdjustedRrUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
        </Grid>


        <Grid Grid.Row="4" Margin="0,14,0,0" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="0"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>

            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="0" FontWeight="DemiBold" HorizontalAlignment="Center">Chi Square</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="1" FontWeight="DemiBold" FontFamily="Pericles, Global User Interface" HorizontalAlignment="Center">X<Run Typography.Variants="Superscript">2</Run></TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="2" FontWeight="DemiBold" HorizontalAlignment="Center">1 Tailed P</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="3" FontWeight="DemiBold" HorizontalAlignment="Center">2 Tailed P</TextBlock>

            <Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"></Border>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="0">Uncorrected (MH)</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="0">Corrected (MH)</TextBlock>

            <TextBlock Name="txtStratChiUnc"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratChiCor"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratChiUnc1Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Right"></TextBlock>
            <TextBlock Name="txtStratChiCor1Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right"></TextBlock>

            <TextBlock Name="txtStratChiUnc2Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Name="txtStratChiCor2Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
        </Grid>
        <Grid Grid.Row="5" Margin="0,14,0,0" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="0"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>

            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="0" FontWeight="DemiBold" HorizontalAlignment="Center">Homogeneity Tests</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="1" FontWeight="DemiBold" FontFamily="Pericles, Global User Interface" HorizontalAlignment="Center">X<Run Typography.Variants="Superscript">2</Run></TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="2" FontWeight="DemiBold" HorizontalAlignment="Center">1 Tailed P</TextBlock>
            <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="3" FontWeight="DemiBold" HorizontalAlignment="Center">2 Tailed P</TextBlock>

            <Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"></Border>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="0">Breslow-Day-Tarone test for Odds Ratios</TextBlock>

            <TextBlock Name="txtStratBDT"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratBDT1Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Right"></TextBlock>

            <TextBlock Name="txtStratBDT2Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="0">Breslow-Day test for Odds Ratios</TextBlock>

            <TextBlock Name="txtStratBDOR"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratBDOR1Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right"></TextBlock>

            <TextBlock Name="txtStratBDOR2Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
            <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="0">Breslow-Day test for Risk Ratios</TextBlock>

            <TextBlock Name="txtStratBDRR"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right">n/a</TextBlock>

            <TextBlock Name="txtStratBDRR1Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Right"></TextBlock>

            <TextBlock Name="txtStratBDRR2Tail" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Right">n/a</TextBlock>
        </Grid>
    </Grid>
</UserControl>
